.data
a : .space 800
b : .word 0
blank : .asciiz " "
_1sc : .asciiz "in f2\n"
.text
__init:
	lui $sp, 0x8000
	addi $sp, $sp, 0x0000
	move $fp, $sp
	add $gp, $gp, 0x8000
	li $8, 1
	sw $8, 800($gp)
	jal main
	li $v0, 10
	syscall
Mars_PrintInt:
	li $v0, 1
	syscall
	li $v0, 4
	move $v1, $a0
	la $a0, blank
	syscall
	move $a0, $v1
	jr $ra
Mars_GetInt:
	li $v0, 5
	syscall
	jr $ra
Mars_PrintStr:
	li $v0, 4
	syscall
	jr $ra
f1:
	subu $sp, $sp, 12
	move $25, $4
	move $24, $5
	add $23, $25, $24
	move $25, $23
	move $24, $25
	move $2, $24
	move $sp, $fp
	jr $31
f2:
	subu $sp, $sp, 20
	la $25, _1sc
	subu $sp, $sp, 4
	sw $fp, ($sp)
	move $fp, $sp
	sw $31, 20($sp)
	move $4, $25
	jal Mars_PrintStr
	lw $31, 20($sp)
	lw $fp, ($sp)
	addu $sp, $sp, 4
	move $sp, $fp
	jr $31
main:
	subu $sp, $sp, 36
	li $25, 1
	move $24, $25
	li $25, 2
	move $23, $25
	seq $25, $24, $0
	xori $25, $24, 0xffffffff
	add $25, $24, $23
	move $22, $25
	rem $25, $24, $23
	move $22, $25
	sllv $25, $24, $23
	move $22, $25
	move $25, $24
	li $22, 1
	add $24, $24, $22
	li $22, 1
	add $24, $24, $22
	move $25, $24
	beq $24, $0, _1shortwaytrue
	sne $v1, $24, $0
	sne $22, $23, $0
	and $22, $22, $v1
	j _1shortwayfalse
_1shortwaytrue:
	li $25, 0
	j _1shortwayend
_1shortwayfalse:
	move $25, $22
_1shortwayend:
	beq $25, $0, _1otherwise1
	sw $24, -4($fp)
	subu $sp, $sp, 4
	sw $fp, ($sp)
	move $fp, $sp
	sw $31, 20($sp)
	move $4, $24
	move $5, $23
	jal f1
	lw $31, 20($sp)
	lw $fp, ($sp)
	addu $sp, $sp, 4
	lw $24, -4($fp)
	move $22, $2
	j _1endif
_1otherwise1:
	seq $25, $24, $0
	beq $25, $0, _1otherwise2
	lw $22, 800($gp)
	sw $24, -4($fp)
	subu $sp, $sp, 4
	sw $fp, ($sp)
	move $fp, $sp
	sw $31, 20($sp)
	move $4, $22
	move $5, $23
	jal f1
	lw $31, 20($sp)
	lw $fp, ($sp)
	addu $sp, $sp, 4
	lw $24, -4($fp)
	move $22, $2
	j _1endif
_1otherwise2:
	sw $24, -4($fp)
	subu $sp, $sp, 4
	sw $fp, ($sp)
	move $fp, $sp
	sw $31, 20($sp)
	jal f2
	lw $31, 20($sp)
	lw $fp, ($sp)
	addu $sp, $sp, 4
	lw $24, -4($fp)
_1endif:
	li $23, 0
	move $22, $23
_1LoopCheckLabel:
	slt $23, $22, $24
	move $24, $23
	beq $24, $0, _1LoopEndLabel
	j _1LoopEndLabel
	j _1LoopStepLabel
	li $24, 1
	add $25, $23, $24
_1LoopStepLabel:
	li $25, 1
	add $22, $22, $25
	j _1LoopCheckLabel
_1LoopEndLabel:
k:
	j k
	li $22, 0
	move $2, $22
	move $sp, $fp
	jr $31
